import java.util.Locale;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LENOVO
 * Date: 2024-08-02
 * Time: 22:28
 */

public class Test {

    public static boolean isLetter(char ch){
        if(Character.isLetter(ch)){
            return true;
        }
        return false;
    }


    public static void main(String[] args) {
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        StringBuilder newString = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (!isLetter(ch)) {
                newString.append(' ');
            } else {
                newString.append(ch);
            }
        }
        String[] strs = newString.toString().trim().split(" ");
        for (int i = 0; i < strs.length; i++) {
            if(!strs[i].isEmpty()){
                count++;
            }
        }
        System.out.println(count);
    }


    public static void main4(String[] args) {
        String str = new String("YouareThechAMpion");
        System.out.println(str.toLowerCase());
    }


    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int lastIndexOfSpace = str.lastIndexOf(" ");
        String lastWord = str.substring(lastIndexOfSpace + 1);
        System.out.println(lastWord.length());
    }


    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String[] strs = str.split(" ");
        System.out.println(strs[strs.length-1].length());
    }


    public static void main1(String[] args) {
/*        Show2 show2 = new Show2();

        show2.show();*/

    }
}
